package com.tiancheng.trade.settlement.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * 已处理状态：finish：完成，unfinish：为完成
 */
@Getter
@AllArgsConstructor
public enum PaymentBillAuditStatusEnum {

    FINISH("finish", "已完成"),

    UN_FINISH("unfinish", "未完成");

    private String code;
    private String desc;

    public static String getDesc(String code) {
        Optional<PaymentBillAuditStatusEnum> found = Arrays.stream(PaymentBillAuditStatusEnum.values()).filter(c -> c.code.equals(code)).findFirst();
        if (found.isPresent()) {
            return found.get().getDesc();
        }
        return "";
    }
}
